Repository navigation
fix(remote-chat): key a remote chat by its room, so one published room is one row (#2797) - #2801
Conversation
…m is one row (#2797) A friend's room reaches this home once per member of that room: every member record carries the same name — the room's own title — at the same home, and remote-chat.js keyed a chat by the member handle, so the friends' list showed one room as many rows (the owner's screenshot has the same row eight times and reads it as one group). open() now reuses the chat holding that name at that home, and sync() opens a room once and keeps it live while any of its members is published. The stored remote.handle stays the one the chat was created with, because the chat's model route names it; a record with no home, or no name of its own, and a chat that recorded neither, keep the plain per-handle rule. Tests: core/test/remote-chat.test.js gains four #2797 cases — one room published once per member is one row, a changed member handle keeps the chat and never marks it gone, a line from another member lands in that one chat, and two names at one home or one name at two homes stay two rows.
|
Verdict: PASS at 1b2b39c Ran at this tip: Not run: Where the duplicate was — list layer, not publication. Before this change Not a UI fold. No client or list-rendering file is in the diff ( Red first, on base. Putting the base blob of User-visible change has its fragment. Scope and shape. The six changed files are exactly the fix, its tests, its docs line, the changelog fragment, and the CI at this tip. 22 check runs; every one success or skipped ( The full-suite 97 failures are this box, not the diff: with no Body metadata is in order: |
Written-by: FlyBot 实现线
Fixes #2797
Owner: Chief
Reviewer: Reviewer
Tip SHA: 1b2b39c
Base: main 5b8d980
What changed
Root cause (what the code showed).
core/src/host/remote-chat.jskeyed a remote chat by thehandle it was published on (
chatOfHandle), so one identity published under several handles openedseveral chats. The publisher names a room once per member of that room — every member record
carries the same
name(the room's own title, e.g.123456 · 刘红升 2, flybot682b8a43, FlyBot) atthe same
home, with a different member handle each — which is exactly the owner's screenshot: thesame title 8+ times, and every row is a real chat record with the same room name. The same shape
also explains the second-order case: when the handle that carried a room changes between polls, the
old chat is kept as
goneand a new row appears beside it.open()now reuses the chat that already holds that room (chatOfRoom: the same name at thesame home) when no chat holds the handle. The stored
remote.handleis not rewritten — thechat's model route (
flybot-remote/<handle>) names it.sync()opens a room once (the rest of its members only keep it from going stale) and keeps thechat live while any member of that room is still published, instead of marking it
gonebecause the particular member handle vanished.
deliver()needed no change: a line from another member of the room reaches the same chat throughopen(), so the reply, the thinking row and the history stay in the one room chat.history is the history it already had. A record with no home, or with no name of its own, and a
chat that recorded neither, keep the plain per-handle rule.
(two friends), stay two rows — the room rule never folds a list.
docs/subsystems/core-host.mdupdated,
changelog.d/2797-remote-room-one-row.fixed.mdadded).Ran at this tip
Not run, and why — this box has no
gitbinary and nodeepseek-harnesscheckout:node scripts/ds-bot-patches.mjs canonical(needsgit diffof the series), the arch-docs gate'sown
git log/git diffpath (proved instead by feeding the six changed paths tocheck-arch-docs.mjsthrough a localgitstand-in: OK with the doc, FAIL without it, so the gatestill bites), and
dev/bench.sh smoke(needs a harness checkout and git).Scope
core/src/host/remote-chat.js— the room key,open(),sync().core/test/remote-chat.test.js— four#2797cases (red first, listed above).patches/ds-bot/files/src/host/remote-chat.js,patches/ds-bot/files/test/remote-chat.test.js— the generated mirrors of the two above (generateneeds git here, so they were written to match andcheckproves they do).docs/subsystems/core-host.md— theremoteChats.syncbullet now states the room rule.changelog.d/2797-remote-room-one-row.fixed.md— one English line, user-visible.Not touched: Bot Social's publish protocol,
.github/,policy/,hold, any other open PR.Checkpoint
{ "pr": 2801, "claim": "Chief", "issue": 2797, "summary": "A friend's room reaches this home once per member, every record carrying the same room title at the same home, and remote-chat.js keyed a chat by the member handle, so one group filled the friends' list with 8+ rows. open() now reuses the chat holding that name at that home, and sync() opens a room once and keeps it live while any member is published. The stored remote.handle is never rewritten (the chat's model route names it), and a line from another member lands in that chat. Two names at one home, and one name at two homes, stay two rows.", "files": ["core/src/host/remote-chat.js", "core/test/remote-chat.test.js", "patches/ds-bot/files/src/host/remote-chat.js", "patches/ds-bot/files/test/remote-chat.test.js", "docs/subsystems/core-host.md", "changelog.d/2797-remote-room-one-row.fixed.md"], "checks": { "ran": "npm --prefix core test; core/test/remote-chat.test.js; plugins; ds-bot-patches check", "result": "green", "at": "1b2b39c446ab3e8a5da84022b28ff17eda31b9f0" }, "next": "none — ready for review" }